From 4dbae1d4bfd510d6485422783c5208097caea67b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 10 Jan 2018 00:02:23 -0500 Subject: [PATCH] Drop unused GDK_GL values And document the existing ones. --- docs/reference/gtk/running.sgml | 41 ++++++++++++++++++++++++++++++++- gdk/gdk.c | 4 +--- gdk/gdkgl.c | 2 +- gdk/gdkinternals.h | 9 ++++---- gtk/inspector/visual.c | 17 ++------------ gtk/inspector/visual.ui | 33 -------------------------- 6 files changed, 48 insertions(+), 58 deletions(-) diff --git a/docs/reference/gtk/running.sgml b/docs/reference/gtk/running.sgml index 8f6d2936be..bc0b9814d6 100644 --- a/docs/reference/gtk/running.sgml +++ b/docs/reference/gtk/running.sgml @@ -309,7 +309,8 @@ nevertheless. The special value all can be used to turn on all - debug options. + debug options. The special value help can be used + to obtain a list of all supported debug options. @@ -396,6 +397,44 @@ nevertheless. + + <envar>GDK_GL</envar> + + + This variable can be set to a list of options that influence various aspects + of the OpenGL support in GTK+. + + + disable + Disable OpenGL support + + + always + Always use OpenGL for rendering + + + software-draw + Use software rendering + + + texture-rectangle + Use the texture rectangle extension + + + legacy + Use a legacy OpenGL context + + + gles + Use a GLES context + + + The special value all can be used to turn on all + options. The special value help can be used + to obtain a list of all supported options. + + + <envar>GTK_CSD</envar> diff --git a/gdk/gdk.c b/gdk/gdk.c index 107e88b9ee..4186ab933e 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -138,9 +138,7 @@ static GCallback gdk_threads_unlock = NULL; static const GDebugKey gdk_gl_keys[] = { { "disable", GDK_GL_DISABLE }, { "always", GDK_GL_ALWAYS }, - { "software-draw", GDK_GL_SOFTWARE_DRAW_GL | GDK_GL_SOFTWARE_DRAW_SURFACE} , - { "software-draw-gl", GDK_GL_SOFTWARE_DRAW_GL }, - { "software-draw-surface", GDK_GL_SOFTWARE_DRAW_SURFACE }, + { "software-draw", GDK_GL_SOFTWARE_DRAW } , { "texture-rectangle", GDK_GL_TEXTURE_RECTANGLE }, { "legacy", GDK_GL_LEGACY }, { "gles", GDK_GL_GLES }, diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c index b831428920..ac8dda947a 100644 --- a/gdk/gdkgl.c +++ b/gdk/gdkgl.c @@ -469,7 +469,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, guint target; paint_context = gdk_gl_context_get_current (); - if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 && + if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW) == 0 && paint_context && GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface && GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region)) diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 3e90979237..55e83ef1a1 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -81,11 +81,10 @@ typedef enum { typedef enum { GDK_GL_DISABLE = 1 << 0, GDK_GL_ALWAYS = 1 << 1, - GDK_GL_SOFTWARE_DRAW_GL = 1 << 2, - GDK_GL_SOFTWARE_DRAW_SURFACE = 1 << 3, - GDK_GL_TEXTURE_RECTANGLE = 1 << 4, - GDK_GL_LEGACY = 1 << 5, - GDK_GL_GLES = 1 << 6 + GDK_GL_SOFTWARE_DRAW = 1 << 2, + GDK_GL_TEXTURE_RECTANGLE = 1 << 3, + GDK_GL_LEGACY = 1 << 4, + GDK_GL_GLES = 1 << 5 } GdkGLFlags; typedef enum { diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c index 03d4a947b1..fae2760cce 100644 --- a/gtk/inspector/visual.c +++ b/gtk/inspector/visual.c @@ -74,7 +74,6 @@ struct _GtkInspectorVisualPrivate GtkWidget *gl_box; GtkWidget *gl_combo; GtkWidget *software_gl_switch; - GtkWidget *software_surface_switch; GtkWidget *texture_rectangle_switch; GtkAdjustment *focus_adjustment; @@ -774,19 +773,15 @@ init_gl (GtkInspectorVisual *vis) _("Not settable at runtime.\nUse GDK_GL=always or GDK_GL=disable instead")); gtk_switch_set_active (GTK_SWITCH (vis->priv->software_gl_switch), - flags & GDK_GL_SOFTWARE_DRAW_GL); - gtk_switch_set_active (GTK_SWITCH (vis->priv->software_surface_switch), - flags & GDK_GL_SOFTWARE_DRAW_SURFACE); + flags & GDK_GL_SOFTWARE_DRAW); gtk_switch_set_active (GTK_SWITCH (vis->priv->texture_rectangle_switch), flags & GDK_GL_TEXTURE_RECTANGLE); if (flags & GDK_GL_DISABLE) { gtk_widget_set_sensitive (vis->priv->software_gl_switch, FALSE); - gtk_widget_set_sensitive (vis->priv->software_surface_switch, FALSE); gtk_widget_set_sensitive (vis->priv->texture_rectangle_switch, FALSE); gtk_widget_set_tooltip_text (vis->priv->software_gl_switch, _("GL rendering is disabled")); - gtk_widget_set_tooltip_text (vis->priv->software_surface_switch, _("GL rendering is disabled")); gtk_widget_set_tooltip_text (vis->priv->texture_rectangle_switch, _("GL rendering is disabled")); } } @@ -829,13 +824,7 @@ update_gl_flag (GtkSwitch *sw, static void software_gl_activate (GtkSwitch *sw) { - update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW_GL); -} - -static void -software_surface_activate (GtkSwitch *sw) -{ - update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW_SURFACE); + update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW); } static void @@ -914,7 +903,6 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass) gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, gl_box); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, gl_combo); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, software_gl_switch); - gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, software_surface_switch); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, texture_rectangle_switch); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, font_scale_entry); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, font_scale_adjustment); @@ -926,7 +914,6 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass) gtk_widget_class_bind_template_callback (widget_class, layout_activate); gtk_widget_class_bind_template_callback (widget_class, widget_resize_activate); gtk_widget_class_bind_template_callback (widget_class, software_gl_activate); - gtk_widget_class_bind_template_callback (widget_class, software_surface_activate); gtk_widget_class_bind_template_callback (widget_class, texture_rectangle_activate); } diff --git a/gtk/inspector/visual.ui b/gtk/inspector/visual.ui index 27d0de116b..ffa09ae03d 100644 --- a/gtk/inspector/visual.ui +++ b/gtk/inspector/visual.ui @@ -713,38 +713,6 @@ - - - True - False - - - True - horizontal - 10 - 40 - - - True - Software Surfaces - start - baseline - 0.0 - - - - - True - end - baseline - 1 - - - - - - - True @@ -803,7 +771,6 @@ - -- 2.30.2